<template>
	<div class="listInfo">
		<div class="crumbs">
		    <el-breadcrumb separator="/">
		        <el-breadcrumb-item><i class="el-icon-lx-calendar"></i>拼团管理</el-breadcrumb-item>
				<el-breadcrumb-item>拼团活动</el-breadcrumb-item>
		    </el-breadcrumb>
		</div>
		<div class="search">
			<el-row style="margin-top: 10px;">
				<el-col :span="2">
					<el-button type="success" icon="el-icon-plus" @click="addgroup" >添加活动</el-button>
				</el-col>
			</el-row>
		</div>
		<el-table
		 :data="actives"
		 border
		 style="width: 100%">
			 <el-table-column
			   prop="commodity_id"
			    align="center"
			   label="活动id"
			   width="60">
			 </el-table-column>
			 <el-table-column
			   prop="money_up"
			    align="center"
			   label="拼团金额"
			   width="80">
			 </el-table-column>
			 <el-table-column
			   prop="day_income"
			    align="center"
			   label="日利润"
			   width="80">
			 </el-table-column>
			 <el-table-column
			   prop="month_income"
			    align="center"
			   label="月利润"
			   width="80">
			 </el-table-column>
			 <el-table-column
			   prop="sell_start_time"
			    align="center"
			   label="合约开始时间"
			   width="120">
			 </el-table-column>
			 <el-table-column
			   prop="sell_end_time"
			    align="center"
			   label="合约结束时间"
			   width="120">
			 </el-table-column>
			 <el-table-column
			   prop="finalist_income"
			    align="center"
			   label="未中收益"
			   width="80">
			 </el-table-column>
			 <el-table-column
			   prop="period"
			    align="center"
			   label="周期"
			   width="80">
			 </el-table-column>
			 <el-table-column
			   prop="create_time"
			    align="center"
			   label="创建时间"
			   width="160">
			 </el-table-column>
			 <el-table-column
			     align="center"
				 width="100"
			 	label="操作">
			     <template slot-scope="scope">
			         <el-button type="text" icon="el-icon-document" @click="handleEidt(scope.row)">
			 		修改
			 		</el-button>
			       <!--  <el-button type="text" icon="el-icon-delete" class="red" @click="handleDel(scope.$index, scope.row)">
			 		删除
			 		</el-button> -->
			     </template>
			 </el-table-column>
		 </el-table>
		 
		 <div class="pagination">
		     <el-pagination background
		 		@current-change="handleCurrentChange"
		 		layout="prev, pager, next"
		 		:total="pages"
		 		:page-size="page_size">
		     </el-pagination>
		 </div>
	</div>
</template>
<script>
	export default{
		data(){
			return{
				actives:[],
				page:1,
				page_size:10,
				pages:0,
			}
		},
		methods:{
			getActives(){
				let pram = {}
				this.$post_('group/group/list-info',pram,(res) => {
				  this.actives = res.data
				})
			},
			handleEidt(row){
				this.$router.push({path:'/page/group/infoa_edit',query:{commodity_id:row.commodity_id}});
			},
			addgroup(){
				this.$router.push({path:'/page/group/group_add'});
			},
			handleCurrentChange(val){
				this.page = val;
				this.getData();
			}
		},
		created(){
			this.getActives()
		}
	}
</script>
<style>
	.search{
		margin-bottom: 10px;
	}
</style>